package com.yijdn.common.exception;

import com.yijdn.common.constant.CodeStatus;
import org.springframework.http.HttpStatus;

/**
 * 自定义异常
 * @author zww
 * @date 2018-03-25 10:40
 * <p>
 * Email 971762302@qq.com
 * <p>
 * Describe:
 */
public class MyException extends RuntimeException {

    private int code = CodeStatus.FAILED.getCode();

    private String msg;


    public MyException(String msg){
        this.msg = msg;
    }

    public MyException(int code, String msg){
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public MyException(int code, String msg, Throwable e){
        super(e);
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
